package com.example.demo.order.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 卡券批次表;
 * </p>
 *
 * @author 涛
 * @since 2024-08-01
 */
@Data
public class OCardBatch implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * id
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    /**
     * 图片
     */
    @TableField("IMG")
    private String img;

    /**
     * 卡券类型
     */
    @TableField("TYPE")
    private String type;

    /**
     * 卡券名称
     */
    @TableField("NAME")
    private String name;

    /**
     * 限定数量;0不限量 大于0的整数限量
     */
    @TableField("LIMIT_COUNT")
    private Integer limitCount;

    /**
     * 领取数量
     */
    @TableField("GET_COUNT")
    private Integer getCount;

    /**
     * 使用数量
     */
    @TableField("USE_COUNT")
    private Integer useCount;

    /**
     * 排序
     */
    @TableField("SORT")
    private String sort;

    /**
     * 状态
     */
    @TableField("STATUS")
    private String status;

    /**
     * 优惠金额
     */
    @TableField("AMOUNT")
    private Integer amount;

    /**
     * 截止日期
     */
    @TableField(value="DEADLINE")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime deadline;

    /**
     * 使用规则
     */
    @TableField("DEMAND")
    private String demand;

    /**
     * 指定派发
     */
    @TableField("IZ_DISTRIBUT")
    private String izDistribut;

    /**
     * 使用条件
     */
    @TableField("USE_CONDITION")
    private String useCondition;

    /**
     * 创建人
     */
    @TableField("CREATED_BY")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value="CREATED_TIME",fill = FieldFill.INSERT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATED_BY")
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value="UPDATED_TIME",fill = FieldFill.UPDATE)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime updatedTime;

    @Override
    public String toString() {
        return "OCardBatch{" +
        "id=" + id +
        ", img=" + img +
        ", type=" + type +
        ", name=" + name +
        ", limitCount=" + limitCount +
        ", getCount=" + getCount +
        ", useCount=" + useCount +
        ", sort=" + sort +
        ", status=" + status +
        ", izDistribut=" + izDistribut +
        ", condition=" + useCondition +
        ", createdBy=" + createdBy +
        ", createdTime=" + createdTime +
        ", updatedBy=" + updatedBy +
        ", updatedTime=" + updatedTime +
        "}";
    }
}
